package fsu.cs.cis5930;

import android.app.Application;
import android.location.Location;
import android.os.Handler;
import fsu.cs.cis5930.ClientActivity.VictimInfo;


/**
 * GlobalApplication: Global object used to facilitate sharing
 * 						of data between activities.
 *
 *	@example If in any activity (or context) you want to get the MAC of the victim. do:
 *		((GlobalApplication) getApplication()).getTargetMAC();
 */
public class GlobalApplication extends Application {

	/** Globally store the connection to the server */
	private Connection mConnection;
	
	/** Globally store the victim information */ 
	private VictimInfo victim;
	
	/** Globally store the adapter used to display the victims */
	private Handler sendVictim;
	private Handler sendExploit;
	
	private Handler contactHandler;
	
	private String myLocation;
	
	public Connection setConnection(Connection.Type mType)
	{mConnection = new Connection(mType, this); return mConnection;}
	
	public Connection getConnection()
	{ return mConnection; }

	public void setVictim(VictimInfo victim) {
		this.victim = victim;
	}

	public VictimInfo getVictim() {
		return victim;
	}

	public Handler setSendVictim(Handler sendVictim) {
		this.sendVictim = sendVictim; return this.sendVictim;
	}

	public Handler getSendVictim() {
		return sendVictim;
	}

	public void setMyLocation(String myLocation) {
		this.myLocation = myLocation;
	}

	public String getMyLocation() {
		return myLocation;
	}

	public void setSendExploit(Handler sendExploit) {
		this.sendExploit = sendExploit;
	}

	public Handler getSendExploit() {
		return sendExploit;
	}

	public void setContactHandler(Handler contactHandler) {
		this.contactHandler = contactHandler;
	}

	public Handler getContactHandler() {
		return contactHandler;
	}


}
